home *** CD-ROM | disk | FTP | other *** search
/ HamCall (April 1991) / HAMCALL CD-ROM (Buckmaster)(April 1991).BIN / prgming / ctutor / bigarray.c < prev    next >
Text File  |  1990-10-14  |  877b  |  43 lines

  1.                                          /* Chapter 7 - Program 4 */
  2. char name1[] = "First Program Title";
  3.  
  4. main()
  5. {
  6. int index;
  7. int stuff[12];
  8. float weird[12];
  9. static char name2[] = "Second Program Title";
  10.  
  11.    for (index = 0;index < 12;index++) {
  12.       stuff[index] = index + 10;
  13.       weird[index] = 12.0 * (index + 7);
  14.    }
  15.  
  16.    printf("%s\n",name1);
  17.    printf("%s\n\n",name2);
  18.    for (index = 0;index < 12;index++)
  19.       printf("%5d %5d %10.3f\n",index,stuff[index],weird[index]);
  20. }
  21.  
  22.  
  23.  
  24. /* Result of execution
  25.  
  26. First program title
  27. Second program title
  28.  
  29.     0    10     84.000
  30.     1    11     96.000
  31.     2    12    108.000
  32.     3    13    120.000
  33.     4    14    132.000
  34.     5    15    144.000
  35.     6    16    156.000
  36.     7    17    168.000
  37.     8    18    180.000
  38.     9    19    192.000
  39.    10    20    204.000
  40.    11    21    216.000
  41.  
  42. */
  43.